package com.google.code.eclipsercpspring.internal;

import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;

public class EclipseSpringPlugin extends Plugin {

   public static final String EXT_BEAN_FACTORY_CONTRIBUTORS = "beanFactoryContributors";

   private static EclipseSpringPlugin plugin;

   public static final String PLUGIN_ID = "com.google.code.eclipse_rcp_spring";

   public static EclipseSpringPlugin getDefault() {
      return plugin;
   }

   private BeanFactoryRegistry beanFactoryRegistry = null;

   public EclipseSpringPlugin() {
      plugin = this;
   }

   public BeanFactoryRegistry getBeanFactoryRegistry() {
      if (beanFactoryRegistry == null) {
         beanFactoryRegistry = new BeanFactoryRegistryImpl();
      }
      return beanFactoryRegistry;
   }

   @Override
   public void start(final BundleContext context) throws Exception {
      super.start(context);
   }

   @Override
   public void stop(final BundleContext context) throws Exception {
      super.stop(context);
      plugin = null;
   }
}
